<template>
	<view class="order-detail">
		<!-- 返回按钮 -->
		<view class="nav-bar">
			<view class="bar-text" @click="goBack">
				<view class="align">

				</view>
				<text>返回</text>
			</view>
		</view>

		<!-- 商品信息 -->
		<view class="product-info">
			<view class="pho">
				<view class="le">
					<image :src="goods.picUrl" mode="" class="fo"></image>
					<view class="k">
						<text class="biao">{{ goods.goodsName }}</text>
						<text class="zhun">暂无</text>
						<view class="font">
							<view class="money">
								<text>￥<span style="font-size: 16px;">{{ goods.price }}</span>.00</text>
							</view>
							<view class="X">
								<text class="">x{{goods.number}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class="order-info" style="margin-bottom: 0px;padding: 20px 0px 0px 0px;">
					<view class="item">
						<text>商品金额</text>
						<text class="price">¥{{ orderInfo.goodsPrice }}.00</text>
					</view>
					<view class="item" style="border-bottom: 0px;">
						<text>快递费用</text>
						<text class="price">¥{{ orderInfo.freightPrice }}.00</text>
					</view>
				</view>
			</view>
		</view>

		<!-- 收货地址 -->
		<view class="address-info">
			<view class="" style="display: flex;    align-items: center;">
				<image src="/static/images/位置.png" mode="" class="dingwei"></image>
				<text style="padding-left:5px;"> {{ orderInfo.consignee }} {{ orderInfo.mobile }}</text>
			</view>
			<text style="padding-left: 35px; color: #969799; font-size: 12px;">{{ orderInfo.address }}</text>
		</view>

		<!-- 订单信息 -->
		<view class="order-info">
			<view class="item">
				<text>下单时间</text>
				<text style="color: #969799;font-size: 14px;">{{ orderInfo.addTime }}</text>
			</view>
			<view class="item">
				<text>订单编号</text>
				<text style="color: #969799; font-size: 14px;">{{ orderInfo.orderSn }}</text>
			</view>
			<view class="item">
				<text>订单概要</text>
				<text>{{ orderInfo.message }}</text>
			</view>
			<view class="item">
				<text>实付款:</text>
				<text class="price">¥{{ orderInfo.actualPrice }}.00</text>
			</view>
		</view>


	</view>
</template>

<script>
	import api from '../../static/request.js'
	export default {
		data() {
			return {
				goods: {},
				orderInfo: {},
			}
		},
		onLoad(option) {
			console.log(option, '传递过来的参数')
			this.getList(option.orderId)
		},
		methods: {
			getList(id) {
				api.get('order/detail?', {
					orderId: id
				}).then(res => {
					console.log(res, '6666'),
						this.goods = res.data.data.orderGoods[0];
						this.orderInfo = res.data.data.orderInfo;
				});

			},
			goBack() {
				uni.navigateTo({
					url:'/pages/orderList/orderList'
				})
			},
		}
	}
</script>

<style>
	@import url('order-detail.css');
</style>